
// AnalyticDrawingView.h : interface of the CAnalyticDrawingView class
//

#pragma once

#include "display/Mouse.h"
#include "AnalyticDrawingDoc.h"

class COpenGLDisplay;

class CAnalyticDrawingView : public CView
{
protected: // create from serialization only
	CAnalyticDrawingView();
	DECLARE_DYNCREATE(CAnalyticDrawingView)

// Attributes
public:
	CAnalyticDrawingDoc* GetDocument() const;

// Operations
public:

// Overrides
public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);

// Implementation
public:
	virtual ~CAnalyticDrawingView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	afx_msg void OnFilePrintPreview();
//	afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
//	afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
	DECLARE_MESSAGE_MAP()
public:
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnDestroy();
	afx_msg void OnSize(UINT nType, int cx, int cy);
protected:
	HGLRC m_hRC;
	CClientDC* m_pDC;
	COpenGLDisplay* m_pDisplay;
	CMouse m_mouse;


public:
	BOOL bSetDCPixelFormat(void);
	virtual void OnInitialUpdate();
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
	afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
//	afx_msg void OnTimer(UINT_PTR nIDEvent);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);

public:
	COpenGLDisplay* GetOpenGLDisplay(){return m_pDisplay;}
	afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
	afx_msg void OnRButtonDblClk(UINT nFlags, CPoint point);
};

#ifndef _DEBUG  // debug version in AnalyticDrawingView.cpp
inline CAnalyticDrawingDoc* CAnalyticDrawingView::GetDocument() const
   { return reinterpret_cast<CAnalyticDrawingDoc*>(m_pDocument); }
#endif

